package com.dhcc.sdc.busi.service.impl;

import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.mapper.Wrapper;
import com.dhcc.core.framework.base.service.impl.BaseServiceImpl;
import com.dhcc.sdc.busi.dao.SdcReportAnalysisDicMapper;
import com.dhcc.sdc.busi.entity.SdcReportAnalysisDic;
import com.dhcc.sdc.busi.service.ISdcReportAnalysisDicService;
import org.springframework.stereotype.Service;

import java.util.List;


/**
 * 质控条目触发记录表数据服务层接口
 * 
 * @ClassName: SdcQcAnalysisDicServiceImpl
 * @Description: TODO
 * @author zhangdc
 * @date 2022-07-26 14:24:20
 */
@Service("sdcReportAnalysisDicService")
	public class SdcReportAnalysisDicServiceImpl extends BaseServiceImpl<SdcReportAnalysisDicMapper, SdcReportAnalysisDic> implements ISdcReportAnalysisDicService {
	/**
	 * @Description：描述
	 * @Title: getAnalysisCaseDic
	 * @return
	 * @see ISdcReportAnalysisDicService#getReportTrendDic()
	 */
	@Override
	public JSONObject getReportTrendDic() {
		JSONObject obj = new JSONObject();
		Wrapper<SdcReportAnalysisDic> wrapper = new EntityWrapper<SdcReportAnalysisDic>();
		wrapper.eq("analysis_type", "chart").eq("analysis_status", 1);
		List<SdcReportAnalysisDic> list = this.baseMapper.selectList(wrapper);
		obj.put("chart", list);
		wrapper = new EntityWrapper<SdcReportAnalysisDic>();
		wrapper.eq("analysis_type", "table");
		list = this.baseMapper.selectList(wrapper);
		obj.put("table", list);
		return obj;
	}

}